package cn.edu.xaut.mybatisers.mall.Service;

import cn.edu.xaut.mybatisers.mall.Entity.Bill;
import cn.edu.xaut.mybatisers.mall.Entity.Commodity;
import cn.edu.xaut.mybatisers.mall.Entity.OrderOneByOne;
import cn.edu.xaut.mybatisers.mall.Exception.ExceptionEntity.BillStatusException;
import com.github.pagehelper.PageInfo;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface BillService {
    ArrayList<Bill> getBillByOrderNumber(Bill bill) throws SQLException;
    String createOrder(Bill bill) throws SQLException;
    String generateUniqueNumber(int customerId);
    Boolean alterBill(Bill bill) throws SQLException, BillStatusException;
    PageInfo<Bill> getAllBillByPage(int consumer_id, int pageNum, int pageSize) throws SQLException;
    PageInfo<Bill> findBillByStatus(int id, int consumer_id,  int pageNum, int pageSize) throws SQLException;
    Boolean addCommodityToOrder(List<OrderOneByOne> orderOneByOnes) throws SQLException;
    List<HashMap<String, Object>> getCommodities(String orderNumber) throws SQLException;
    Map<String, Object> submitBill(String orderNumber) throws SQLException;
    int deleteOrder(Bill bill) throws SQLException;
    boolean comment(OrderOneByOne orderOneByOne) throws SQLException;
    boolean deleteComment(OrderOneByOne orderOneByOne) throws SQLException;
}
